package com.ifdom.dynamicproxy.staticstate;

/**
 * 静态代理
 * 优点：没有侵入原代码，达到了功能增强的目的
 * 缺陷：代理多个类时，需要定义多个统一接口
 * @Author ifredomvip@gmail.com
 * @Date 2022/9/15 14:24
 * @Version 1.0.0
 * @Description
 **/
public class StaticProxy implements SourceService {
    @Override
    public void update() {
        before();
        System.out.println("update method called");
        after();
    }

    @Override
    public void select() {
        before();
        System.out.println("select method called");
        after();
    }


    public void before() {
        System.out.println("before called.");
    }

    public void after() {
        System.out.println("after called.");
    }
}
